/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package profesores;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author PACHITO
 */
@WebServlet(name = "nuevoformulario", urlPatterns = {"/nuevoformulario"})
public class nuevoformulario extends HttpServlet {

    /**
     * Processes requests for both HTTP
     * <code>GET</code> and
     * <code>POST</code> methods.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {
            /* TODO output your page here. You may use following sample code. */
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet nuevoformulario</title>");
            out.println("</head>");
            out.println("<body>");
            out.println("<h1>Servlet nuevoformulario at " + request.getContextPath() + "</h1>");
            out.println("</body>");
            out.println("</html>");
        } finally {
            out.close();
        }
    }

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /**
     * Handles the HTTP
     * <code>GET</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {
            out.println("<tr>\n"
                    + "<td colspan=\"2\">\n"
                    + "<input type=\"checkbox\" name=\"pre_escolar\" value=\"\"  id=\"pre\" onchange=\"cajasmateriapre();\" /> Pre-Escolar</br>\n"
                    + "</td>\n"
                    + "<td colspan=\"2\">\n"
                    + "<input type=\"checkbox\" name=\"primaria\" value=\"\"  id=\"pri\" onchange=\"cajasmateriapri();\"/> Primaria</br>\n"
                    + "</td>\n"
                    + "<td colspan=\"2\">\n"
                    + "<input type=\"checkbox\" name=\"secundaria\" value=\"\" id=\"sec\" onchange=\"cajasmateriasec();\" /> secundaria</br>\n"
                    + "</td>\n"
                    + "</tr>\n"
                    + "<tr>\n"
                    + "<td colspan=\"2\"><div id=\"checkpre\"></div></br></td>\n"
                    + "<td colspan=\"2\"><div id=\"checkpri\"></div></br></td>\n"
                    + "<td colspan=\"2\"><div id=\"checksec\"></div></br></td>\n"
                    + "</tr>\n"
                    + "<tr>\n"
                    + "<td colspan=\"2\"><input type=\"checkbox\" name=\"bachig\" value=\"\" id=\"bag\" onchange=\"cajasmateriabag();\"/> Bachillerato G.</br></td>\n"
                    + "<td colspan=\"2\"><input type=\"checkbox\" name=\"bachit\" value=\"\" id=\"tec\" onchange=\"cajasmateriatec();\"/> Bachillerato T.</br></td>\n"
                    + "<td colspan=\"2\"><input type=\"checkbox\" name=\"licenciatura\" value=\"\" id=\"lic\" onchange=\"cajasmaterialic();\"/> Licenciatura</br></td>\n"
                    + "</tr>\n"
                    + "<tr>\n"
                    + "<td colspan=\"2\"> <div id=\"checkbag\"></div></br></td>\n"
                    + "<td colspan=\"2\"><div id=\"checktec\"></div></br></td>\n"
                    + "<td colspan=\"2\"><div id=\"checklic\"></div></br></td>\n"
                    + "</tr>\n"
                    + "<tr>\n"
                    + "<td colspan=\"2\"><input type=\"checkbox\" name=\"maestria\" value=\"\" id=\"mas\" onchange=\"cajasmateriamas();\"/> Maestria</br></td>\n"
                    + "<td colspan=\"2\"><input type=\"checkbox\" name=\"doctorado\" value=\"\" id=\"doc\" onchange=\"cajasmateriadoc();\"/> Doctorado</br></td>\n"
                    + "</tr>\n"
                    + "<tr>\n"
                    + "<td colspan=\"2\"><div id=\"checkmas\"></div></br></td>\n"
                    + "<td colspan=\"2\"><div id=\"checkdoc\"></div></br></td>\n"
                    + "</tr>");
        } finally {
            out.close();
        }
    }

    /**
     * Handles the HTTP
     * <code>POST</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>
}
